<!--
 * @Author: Lixuening
 * @description: 封装element下拉选择框组件公共
 * @LastEditTime: 2021-06-28 14:15:11
-->

<template>
  <div class="wrap">
        <el-select clearable v-model="currentValue" @change="changeValue" :placeholder="placeholder">
            <el-option
            v-for="item in optionList"
            :key="item"
            :label="item"
            :value="item">
            </el-option>
        </el-select>
  </div>
</template>

<script>
export default {
  name: "Sel",
  props: {
    optionList: {
      type: Array,
      default() {
        return [];
      },
    },
    placeholder: {
        type: String,
        default() {
            return '';
        }
    }
  },
  data() {
    return {
      currentValue: "",
    };
  },
  mounted() {
    this.currentValue = this.value;
  },
  methods: {
    changeValue() {
      this.$emit("change", this.currentValue);
    },
  },
};
</script>

<style lang="scss" scoped>
    .wrap {
        padding-bottom: 10px;
    }
</style>